import {observable,action,toJS} from "mobx";
import * as Apis from "../../apis/docReportApi/moreListApi";
import { SearchAdvanced,ListViewPage } from 'weaver-mobile-page';


class MoreDialogStore{
  @observable list = new ListViewPage.Store({ route: '/docReport' });

  @action.bound 
  getList(formData,v="",echartType){
    let params = {
      ...formData,
      name:v,
      analyseType:echartType,
    }
    if(echartType){
      delete params.echartKey;
    }
    if(echartType == 1 || echartType == 2 || echartType == 3){
      Apis.getOdocDocReportEchartDetailList(params).then(data=>{
        if(data.sessionkey){
          this.list.getData({ dataKey:data.sessionkey},undefined,true);
        }
      })
    }else{  
      Apis.getOdocReportEchartDetailList(params).then(data=>{
        if(data.sessionkey){
          this.list.getData({ dataKey:data.sessionkey},undefined,true);
        }
      })
    }
   

    
  }




}

export default MoreDialogStore;